package com.yitiao.designmodel.struct.bridge;

/**
 * 桥接模式测试类
 */
public  class MainTest {
    public static void main(String[] args) {
        IPhone12 iPhone12 = new IPhone12();
        iPhone12.setName("IPhone12");
        // 价格以分为单位
        iPhone12.setSale(new OnlineSale(599900,"online"));

        String info = iPhone12.getInfo();
        System.out.println(info);

        IPhone12pro iPhone12pro = new IPhone12pro();
        iPhone12pro.setName("IPhone12pro");
        iPhone12pro.setSale(new OfflineSale(799900,"offline"));

        String proInfo = iPhone12pro.getInfo();
        System.out.println(proInfo);

        IPhone12ProMax iPhone12ProMax = new IPhone12ProMax();
        iPhone12ProMax.setName("IPhone12ProMax");
        iPhone12ProMax.setSale(new StuSale(1090000,"stu"));

        String maxInfo = iPhone12ProMax.getInfo();
        System.out.println(maxInfo);
    }
}
